package com.gxa.finance.controller;

import com.gxa.common.commons.R;
import com.gxa.common.pojo.ServiceNode;
import com.gxa.finance.service.ServiceNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@RestController
@RequestMapping("/finance/ServiceNode")
public class ServiceNodeController {

    @Autowired
    private ServiceNodeService ServiceNodeService;

    //1、查询接口
    @GetMapping("/findServiceNodeList")
    public R findServiceNodeList (String serve,Integer price){

        return ServiceNodeService.findServiceNodeList(serve,price);
    }

    //2、添加
    @PostMapping("/addServiceNode")
    public R addServiceNode (@RequestBody ServiceNode ServiceNode){

        return ServiceNodeService.addServiceNode(ServiceNode);
    }

    //3、删除
    @PostMapping("/delServiceNode")
    public R delServiceNode (Integer id){

        return ServiceNodeService.delServiceNode(id);
    }

    //修改
    @PostMapping("/updateServiceNode")
    public R updateServiceNode (@RequestBody ServiceNode ServiceNode){

        return ServiceNodeService.updateServiceNode(ServiceNode);
    }

}
